<template>
  <div style="height: 200rpx;">
    <div @click="shareIndetail">点击按钮</div>
    <div>
      你选择了{{menu}}
    </div>
    <created-image v-if="showCreatedImg" :imgUrl="imgUrl" @cancel="cancel"></created-image>
  </div>
</template>
<script>
 import createdImage from '@/components/indetail-bottom/created-image'
  export default {
    components: {
      createdImage
    },
    data() {
      return {
        showCreatedImg: true,
        imgUrl: ''
      }
    }, 
    methods:{
      cancel(){
        this.showCreatedImg = false
      },
      shareIndetail(){
        let that = this
        wx.showActionSheet({
          itemList: ['生成海报'],
          success(res) {
            wx.showLoading({ //数据请求前loading，
              title: '生成中',
            })
            that.showCreatedImg = true
            that.createdImage()
          },
          fail(res) {
            console.log(res.errMsg)
          }
        })
      },
      createdImage(){
        //这里有一个请求
        wx.hideLoading()
      },
    }
  }
</script>

<style scoped>
</style>
